// c:\Users\25977\Desktop\新建文件夹 (2)\TayenOrbit\pages\home\new-detail\new-detail.js
import http from '../../../common/request'

Page({
  data: {
    id:'',
    infoData:{}
  },
  onLoad(options) {
    this.setData({
      id:options.id
    })
    this.articleInfoApi(options.id)
  },
  async onPullDownRefresh() {
    await this.articleInfoApi(this.data.id)
    await tt.stopPullDownRefresh();
  },
  async articleInfoApi(infoId) {
    await http.request({
      url: '/article/info',
      method: 'GET',
      data:{
        id:infoId
      }
    }).then(({ data }) => {
      console.log(data, 9999)
      this.setData({
        infoData:data
      })
    }).catch((err) => {
      console.log('请求失败', err)
      tt.showLoading({
        title: err.msg
      })
    })
  }
})